<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center templeActivities_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub templeActivities_fd0_0'>
          <view class='flex flex-wrap align-center templeActivities_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  templeActivities_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='templeActivities_fd0_0_c1_c0'>{{title}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end templeActivities_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="flex benben-position-layout flex flex-wrap align-center templeActivities_flex_1"
        :style="{top:(88+StatusBarRpx)+'rpx', }">
        <view class="clearfix container-boxs">
          <view class="float_left container-item" :class="tabls==4 ? 'active':''" @tap="chooseCate('4')">
            {{$t('法会活动')}}
            <view class="templeActivities_linefd1_0" v-if="tabls==4"></view>
          </view>
          <view class="float_left container-item" :class="tabls==3 ? 'active':''" @tap="chooseCate('3')">
            {{$t('活动介绍')}}
            <view class="templeActivities_linefd1_0" v-if="tabls==3"></view>
          </view>
          <!-- <view class="float_left container-item" :class="tabls==2 ? 'active':''" @tap="chooseCate('2')">
            {{$t('法会共修')}}
            <view class="templeActivities_linefd1_0" v-if="tabls==2"></view>
          </view> -->
          <view class="float_left container-item" :class="tabls==1 ? 'active':''" @tap="chooseCate('1')">
            {{$t('教育')}}
            <view class="templeActivities_linefd1_0" v-if="tabls==1"></view>
          </view>
          <!--          <benben-flex-tabs class-name='templeActivities_benbenTabsfd1_0' v-model="tabls" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="switchDataFunc()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center justify-around flex ">
                  <view :class="{ 'checkTitlefd1_0': tabls == '4', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '4'" :id="`benben_tabsfd1_0-title-item-${'4'}`">

                    {{$t('活动')}}

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabls == '3', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <view>{{$t('活动介绍')}}</view>

                  </view>

                  <view :class="{ 'checkTitlefd1_0': tabls == '2', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                    <view>{{$t('法会共修')}}</view>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': tabls == '1', 'flex flex-wrap align-center': true }"
                    @tap="tabls = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <view>{{$t('教育')}}</view>

                  </view>


                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line"
                  class="benben-tabs-line flex benben-flex-tabs-line templeActivities_linefd1_0"></view>
              </view>
            </scroll-view>

          </benben-flex-tabs> -->

        </view>

      </view>
      <view :style="{height: '90rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout templeActivities_flex_2"
        v-if=" tabls=='1'">
        <template v-for='(item,key0) in educationList'>
          <view class='flex flex-wrap align-center templeActivities_fd2_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/shouye/educationDetails/educationDetails?id=${item.aid}`"
            :key='key0'>
            <image class='templeActivities_fd2_0_c0' mode="aspectFill" :src='item.img'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub templeActivities_fd2_0_c1'>
              <text class='templeActivities_fd2_0_c1_c0'>{{item.title}}</text>
              <view class='flex flex-wrap align-center templeActivities_fd2_0_c1_c1'>
                <text class='templeActivities_fd2_0_c1_c1_c0'>{{$t('地点')}}：{{item.address}}</text>
                <!-- <text class='templeActivities_fd2_0_c1_c1_c0'></text> -->
              </view>
              <view class='flex flex-wrap align-center templeActivities_fd2_0_c1_c1'>
                <text class='templeActivities_fd2_0_c1_c1_c0'>{{$t('活动时间')}}：</text>
                <text class='templeActivities_fd2_0_c1_c1_c0'>{{item.stime}}</text>
                <text class='templeActivities_fd2_0_c1_c1_c0'>{{$t('至')}}</text>
                <text class='templeActivities_fd2_0_c1_c1_c0'>{{item.end_time}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout templeActivities_flex_3"
        v-if=" tabls=='2'">
        <template v-for='(item,key0) in societyList'>
          <view class='flex flex-wrap align-center templeActivities_fd3_0' :key='key0' @tap.stop="goVideo(item)"
            data-type="navigateTo" :data-url="`/pages/benben-built-in/web-view/web-view?webPath=${item.Link}`">
            <image class='templeActivities_fd3_0_c0' mode="aspectFill" :src='item.img'></image>
            <text class='templeActivities_fd3_0_c1'>{{item.title}}</text>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout templeActivities_flex_4"
        v-if=" tabls=='3'">
        <template v-for='(item,key0) in introduceList'>
          <view class='flex flex-wrap align-center templeActivities_fd4_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/shouye/articleDtails/articleDtails?id=${item.aid}`" :key='key0'>
            <image class='templeActivities_fd4_0_c0' mode="aspectFill" :src='item.img'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub templeActivities_fd4_0_c1'>
              <text class='templeActivities_fd4_0_c1_c0'>{{item.title}}</text>
              <view class='flex flex-wrap align-center templeActivities_fd4_0_c1_c1'>
                <text class='templeActivities_fd4_0_c1_c1_c0'>{{$t('发布时间')}}:</text>
                <text class='templeActivities_fd4_0_c1_c1_c0'>{{item.create_time}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout templeActivities_flex_5"
        v-if=" tabls=='4'">
        <template v-for='(item,key0) in activityList'>
          <view class='flex flex-wrap align-center templeActivities_fd5_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/shouye/eventDetails/eventDetails?id=${item.aid}`" :key='key0'>
            <image class='templeActivities_fd5_0_c0' mode="aspectFill" :src='item.img'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub templeActivities_fd5_0_c1'>
              <text class='templeActivities_fd5_0_c1_c0'>{{item.title}}</text>
              <view class='flex flex-wrap align-center templeActivities_fd5_0_c1_c1'>
                <text class='templeActivities_fd5_0_c1_c1_c0'>{{$t('地点')}}:{{item.address}}</text>
                <!-- <text class='templeActivities_fd5_0_c1_c1_c0'></text> -->
              </view>
              <view class='flex flex-wrap align-center templeActivities_fd5_0_c1_c1'>
                <text class='templeActivities_fd5_0_c1_c1_c0'>{{$t('活动时间')}}:</text>
                <text class='templeActivities_fd5_0_c1_c1_c0'>{{item.start_time}}</text>
                <text class='templeActivities_fd5_0_c1_c1_c0'>{{$t('至')}}</text>
                <text class='templeActivities_fd5_0_c1_c1_c0'>{{item.end_time}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "tabls": "4",
        "educationList": [],
        "societyList": [],
        "introduceList": [],
        "activityList": [],
        title: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.title = options.name
      this.switchDataFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.switchDataFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      chooseCate(type) {
        this.tabls = type
        this.switchDataFunc()
      },
      goVideo(item) {
        console.log('item')
        uni.navigateTo({
          url: `/pages/shouye/articleDetails/fahuidetail?id=${item.aid}`
        })
      },
      //获取教育列表
      geteducationListFunc() {
        this.minixPagingListsApi = global.apiUrls.post655ffe301c115;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {}
        this.listData = [];
        this.educationList = this.listData;
        this.pagingListToggle();

      },
      //获取法会公修列表
      getSocietylistFunc() {
        this.minixPagingListsApi = global.apiUrls.post65601b59bd67d;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {}
        this.listData = [];
        this.societyList = this.listData;
        this.pagingListToggle();

      },
      //获取活动介绍列表
      getIntroduceFunc() {
        this.minixPagingListsApi = global.apiUrls.post655ffd541fda9;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {}
        this.listData = [];
        this.introduceList = this.listData;
        this.pagingListToggle();

      },
      //获取活动报名列表 post6560385f8e11c
      getActivityFunc() {
        this.minixPagingListsApi = global.apiUrls.post65601d56ce781;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {}
        this.listData = [];
        this.activityList = this.listData;
        this.pagingListToggle();

      },
      //切换请求数据
      switchDataFunc() {
        if (this.tabls == '1') {
          this.geteducationListFunc()
        } else if (this.tabls == '2') {
          this.getSocietylistFunc()
        } else if (this.tabls == '3') {
          this.getIntroduceFunc()
        } else if (this.tabls == '4') {
          this.getActivityFunc()
        }
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .container-boxs {
    width: 750rpx;
  }

  .container-item {
    text-align: center;
    width: 25%;
    position: relative;

    &.active {
      color: rgba(145, 47, 34, 1)
    }

    .templeActivities_linefd1_0 {
      // position: absolute;
      margin-left: 43%;
      background: rgba(145, 47, 34, 1);
      width: 16rpx;
      height: 16rpx;
      bottom: -20rpx;
      left: 43%;
      z-index: 9;
      border-radius: 100rpx;
    }
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% auto;
  }

  .templeActivities_flex_0 {
    border-bottom: 1px solid #eee;
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .templeActivities_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .templeActivities_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .templeActivities_fd0_0_c0 {
    width: 120rpx;
  }

  .templeActivities_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .templeActivities_flex_1 {
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    min-height: 90rpx;
    overflow: hidden;
    z-index: 10;
    top: 88rpx;
    background-size: 100% auto;
  }



  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #912F22 !important;
  }

  ::v-deep .templeActivities_benbenTabsfd1_0 {
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 28rpx;
    font-weight: 400;
    color: #666666;
  }

  .templeActivities_flex_2 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .templeActivities_fd2_0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 36rpx;
  }

  .templeActivities_fd2_0_c1_c1 {
    margin: 6rpx 0rpx 0rpx 0rpx;
  }

  .templeActivities_fd2_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .templeActivities_fd2_0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .templeActivities_fd2_0_c0 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 24rpx;
  }

  .templeActivities_fd2_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .templeActivities_flex_3 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .templeActivities_fd3_0_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
    width: 416rpx;
  }

  .templeActivities_fd3_0_c0 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 24rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .templeActivities_fd3_0 {
    background: rgba(255, 255, 255, 1);
    margin: 0rpx 0rpx 24rpx 0rpx;
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 38rpx 32rpx 24rpx;
  }

  .templeActivities_flex_4 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .templeActivities_fd4_0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 36rpx;
  }

  .templeActivities_fd4_0_c1_c1 {
    margin: 45rpx 0rpx 0rpx 0rpx;
  }

  .templeActivities_fd4_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .templeActivities_fd4_0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .templeActivities_fd4_0_c0 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 24rpx;
  }

  .templeActivities_fd4_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .templeActivities_flex_5 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .templeActivities_fd5_0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 36rpx;
  }

  .templeActivities_fd5_0_c1_c1 {
    margin: 6rpx 0rpx 0rpx 0rpx;
  }

  .templeActivities_fd5_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .templeActivities_fd5_0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .templeActivities_fd5_0_c0 {
    width: 160rpx;
    height: 160rpx;
    border-radius: 24rpx;
  }

  .templeActivities_fd5_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
  }
</style>
